// 过滤路由

export const filterRoute = (asyncRoute: any[], route: string[]) => {
    // 过滤路由逻辑
    let arr = JSON.parse(JSON.stringify(asyncRoute));
        arr = arr.filter((item: any )=> {
        if(route.includes(item.name)) {
            if(item.children && item.children.length > 0) {
                item.children = filterRoute(item.children, route)
            }
            return true
        } else {
            return false
        }
        
    })
    return arr

}